const state = {
  // m-header公共的下拉框选中的值
  facility: 1,
  facilitys: [],
  // end
  nav_resize: false,
  user: 'logo',
  spaces: [],
  selections: [],
  menus: [],
  topMenuUrl: '/'
}
// m-header 下拉框公共 选择的异步行为
const actions = {
  // 站房的数组的选中的值
  getFacility ({commit}, facility) {
    commit('getFacility', facility)
  },
  // 站房的数组
  getFacilitys ({commit}, facilitys) {
    commit('getFacilitys', facilitys)
  }
}
const mutations = {
  // m-header 下拉框公共 选择的异步行为
  getFacility (state, facility) {
    state.facility = facility
  },
  getFacilitys (state, facilitys) {
    state.facilitys = facilitys
  },
  updateState (state, obj) {
    for (let key in obj) {
      state[key] = obj[key]
    }
  },
  addSpaces (state, newData) {
    state.spaces = newData
  },
  addOpts (state, newData) {
    state.selections = newData
  },
  addMenus (state, newData) {
    console.log('dsfaaaaaaaaaaa', newData)
    state.menus = newData
  },
  addTopMenuUrl (state, newData) {
    state.topMenuUrl = newData
  },
  addLoginer (state, newData) {
    state.user = newData
  }
}
export default {
  namespaced: true,
  state,
  actions,
  mutations
}
